#ifndef GLOBAL_DATA_H
#define GLOBAL_DATA_H

#include <cstdlib>

#define TWO_MOTORS 1
#define MOTORS_DIRECTION_SYNC 1

#define JOYSTICK_DEADBAND 0.05
#define JOYSTICK_CENTER 0

// ******************************************************* //
// ********** ELECTRONICS CHANNEL SPECIFICATION ********** //

// Driver Control Slots
#define JOYSTICK_DRIVER_1_PORT 1
#define JOYSTICK_DRIVER_2_PORT 2
#define JOYSTICK_OPERATOR_1_PORT 3
#define JOYSTICK_OPERATOR_2_PORT 4
	
// Driver Control Buttons
// Drive train
#define JOYSTICK_ARCADE_TOGGLE 3

#if TWO_MOTORS
	#define DRIVETRAIN_L_PWM 1
	#define DRIVETRAIN_R_PWM 2
#else
// PWM Slots
	#define DRIVETRAIN_L_1_PWM 1
	#define DRIVETRAIN_L_2_PWM 2
	#define DRIVETRAIN_R_1_PWM 3
	#define DRIVETRAIN_R_2_PWM 4

#endif

class GlobalData 
{

public:
	~GlobalData();
	//Gives every class the same instance of GlobalData
	static GlobalData* GetInstance();

	
	// ********************************** //
	// ********** Sensor Input ********** //
	
	// DRIVER CONTROL INPUT
	// Drive train
	float i_joystick_1_x;
	float i_joystick_1_y;
	float i_joystick_2_x;
	float i_joystick_2_y;
	bool i_joystickArcadeToggle;
	
	
	// ************************************* //
	// ********** ACTUATOR OUTPUT ********** //
	// Drive train
	double o_drivetrainLeft;
	double o_drivetrainRight;


private:
	//The instance of GlobalData that every class gets
	//static GlobalData* m_globals;
	GlobalData();
	
	static GlobalData staticGlobals;
};

#endif
